package com.zxx.pattern.buildPattern.build4_ZZ;

/**
 * @author zxx on 2020/12/11
 */
public class Test4 {

    public static void main(String[] args) {
        String choice="plain";
//        String choice = "html";
        if (choice.equals("plain")) {
            TextBuilder t = new TextBuilder();
            Director4 d = new Director4(t);
            d.construct();
            System.out.println(t.getResult());

        } else if (choice.equals("html")) {
            HtmlBuilder html = new HtmlBuilder();
            Director4 d = new Director4(html);
            d.construct();
            System.out.println(html.getFileName());
        } else {
            usage();
        }
    }

    private static void usage() {
        System.out.println("使用 plain，编辑文本文件");
        System.out.println("使用 html，编辑网页文件");
    }

}
